package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.system.domain.deptSchool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DepartmentMapper;
import com.ruoyi.system.domain.Department;
import com.ruoyi.system.service.DepartmentService;

/**
 * 【请填写功能名称】Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-08-15
 */
@Service
public class DepartmentServiceImpl implements DepartmentService
{
    @Autowired
    private DepartmentMapper departmentMapper;

    /**
     * 查询【请填写功能名称】
     * 
     * @param departmentId 【请填写功能名称】主键
     * @return 【请填写功能名称】
     */
    @Override
    public Department selectDepartmentByDepartmentId(Long departmentId)
    {
        return departmentMapper.selectDepartmentByDepartmentId(departmentId);
    }

    /**
     * 查询【请填写功能名称】列表
     * 
     * @param department 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<Department> selectDepartmentList(Department department)
    {
        return departmentMapper.selectDepartmentList(department);
    }

    /**
     * 新增【请填写功能名称】
     * 
     * @param department 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertDepartment(Department department)
    {
        return departmentMapper.insertDepartment(department);
    }

    /**
     * 修改【请填写功能名称】
     * 
     * @param department 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateDepartment(Department department)
    {
        return departmentMapper.updateDepartment(department);
    }

    /**
     * 批量删除【请填写功能名称】
     * 
     * @param departmentIds 需要删除的【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteDepartmentByDepartmentIds(Long[] departmentIds)
    {
        return departmentMapper.deleteDepartmentByDepartmentIds(departmentIds);
    }

    /**
     * 删除【请填写功能名称】信息
     * 
     * @param departmentId 【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteDepartmentByDepartmentId(Long departmentId)
    {
        return departmentMapper.deleteDepartmentByDepartmentId(departmentId);
    }

    @Override
    public List<deptSchool> selectName(String c_name,String d_name) {
        System.out.println(d_name);
        return departmentMapper.selectName(c_name,d_name);
    }
    @Override
    public List<Department> selectDepartmentByDepartmentName(String name) {
        return departmentMapper.selectDepartmentByDepartmentName(name);
    }
    @Override
    public Department selectByTwoDept(String name) {
        return departmentMapper.selectByTwoDept(name);
    }
}
